package leetcode;

public class MaxScoreSightseeingPair {
    public int maxScoreSightseeingPair(int[] values) {
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < values.length - 1; i++) {
            for (int j = i + 1; j < values.length; j++) {
                max = Math.max(max, (values[j] + values[i] + i - j));
            }
        }
        return max;
    }

    public static void main(String[] args) {
        MaxScoreSightseeingPair maxScoreSightseeingPair = new MaxScoreSightseeingPair();
        int[] values = {8, 1, 5, 2, 6};
        System.out.println(maxScoreSightseeingPair.maxScoreSightseeingPair(values));
    }
}